package com.syn.config;

import com.syn.entity.B;
import com.syn.mapper.UserMapper;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Arrays;
import java.util.List;


public class SynFactoryBean implements FactoryBean {
    private Class bean;
    public SynFactoryBean(Class bean){
        this.bean=bean;
    }
    @Override
    public Object getObject() throws Exception {
        Object o =  Proxy.newProxyInstance(SynFactoryBean.class.getClassLoader(), new Class[]{bean}, new SynInvocationHandle() );
        return o;
    }

    @Override
    public Class<?> getObjectType() {
        return bean;
    }
}
